// @ts-ignore
/* eslint-disable */
import request from '@/request/http'

/** 修改 修改UpdateVO中不为空的字段 PUT /baseRole */
export async function update(body: API.BaseRoleUpdateVO, options?: { [key: string]: any }) {
  return request<API.RBaseRole>(`/base/baseRole`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 新增 POST /baseRole */
export async function save(body: API.BaseRoleSaveVO, options?: { [key: string]: any }) {
  return request<API.RBaseRole>(`/base/baseRole`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 删除 DELETE /baseRole */
export async function deleteUsingDelete(body: number[], options?: { [key: string]: any }) {
  return request<API.RBoolean>(`/base/baseRole`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 单体查询 单体查询 GET /baseRole/${param0} */
export async function get(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<API.RBaseRoleResultVO>(`/base/baseRole/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {})
  })
}

/** 检测角色编码 GET /baseRole/check */
export async function check(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.checkParams,
  options?: { [key: string]: any }
) {
  return request<API.RBoolean>(`/base/baseRole/check`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 清理缓存 清理缓存 POST /baseRole/clearCache */
export async function clearCache(body: number[], options?: { [key: string]: any }) {
  return request<API.RBoolean>(`/base/baseRole/clearCache`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 复制 POST /baseRole/copy */
export async function copy(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.copyParams,
  options?: { [key: string]: any }
) {
  return request<API.RBaseRole>(`/base/baseRole/copy`, {
    method: 'POST',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 查询单体详情 GET /baseRole/detail */
export async function getDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getDetailParams,
  options?: { [key: string]: any }
) {
  return request<API.RBaseRoleResultVO>(`/base/baseRole/detail`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 查询角色绑定的员工 GET /baseRole/employeeList */
export async function findEmployeeIdByRoleId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.findEmployeeIdByRoleIdParams,
  options?: { [key: string]: any }
) {
  return request<API.RListLong>(`/base/baseRole/employeeList`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 根据Id批量查询 根据Id批量查询 POST /baseRole/findByIds */
export async function findByIds(body: number[], options?: { [key: string]: any }) {
  return request<API.RListBaseRoleResultVO>(`/base/baseRole/findByIds`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 查询角色拥有的数据权限ID GET /baseRole/findResourceDataScopeIdByRoleId */
export async function findResourceDataScopeIdByRoleId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.findResourceDataScopeIdByRoleIdParams,
  options?: { [key: string]: any }
) {
  return request<API.RMapLongCollectionLong>(`/base/baseRole/findResourceDataScopeIdByRoleId`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 查询员工拥有的角色编码 GET /baseRole/findRoleCodeByEmployeeId */
export async function findRoleCodeByEmployeeId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.findRoleCodeByEmployeeIdParams,
  options?: { [key: string]: any }
) {
  return request<API.RListString>(`/base/baseRole/findRoleCodeByEmployeeId`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 分页列表查询 POST /baseRole/page */
export async function page(
  body: API.PageParamsBaseRolePageQuery,
  options?: { [key: string]: any }
) {
  return request<API.RIPageBaseRoleResultVO>(`/base/baseRole/page`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 分页查询员工的角色 分页查询员工的角色 POST /baseRole/pageMyRole */
export async function pageMyRole(
  body: API.PageParamsBaseRolePageQuery,
  options?: { [key: string]: any }
) {
  return request<API.RIPageBaseRoleResultVO>(`/base/baseRole/pageMyRole`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 批量查询 批量查询 POST /baseRole/query */
export async function query(body: API.BaseRolePageQuery, options?: { [key: string]: any }) {
  return request<API.RListBaseRoleResultVO>(`/base/baseRole/query`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 刷新缓存 刷新缓存 POST /baseRole/refreshCache */
export async function refreshCache(body: number[], options?: { [key: string]: any }) {
  return request<API.RBoolean>(`/base/baseRole/refreshCache`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 查询角色拥有的资源id集合 GET /baseRole/resourceList */
export async function findResourceIdByRoleId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.findResourceIdByRoleIdParams,
  options?: { [key: string]: any }
) {
  return request<API.RMapLongCollectionLong>(`/base/baseRole/resourceList`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 给角色分配员工 给角色分配员工 POST /baseRole/roleEmployee */
export async function saveRoleEmployee(
  body: API.RoleEmployeeSaveVO,
  options?: { [key: string]: any }
) {
  return request<API.RListLong>(`/base/baseRole/roleEmployee`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 给角色配置资源 POST /baseRole/roleResource */
export async function saveRoleResource(
  body: API.BaseRoleResourceRelSaveVO,
  options?: { [key: string]: any }
) {
  return request<API.RBoolean>(`/base/baseRole/roleResource`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}
